package j07zuoye;

public class J1exam {
    /*
1-100，不能被3除尽
 */

    public static void main(String[] args) {
        int sum = 0;
        for (int i = 1; i < 100; i++) {
            if(i%3!=0)sum+=i;
        }
        System.out.println("sum = " + sum);


        /*
        if(){}  单分支
        if(){}else{}  双分支
        if(){}else if(){}....else{} 多分支
         */
        System.out.println("===========");
        cost6();
    }

    public static void cost6() {
        //总钱数
        double total = 0;
        //用的天数
        int day = 0;
        while (true){
            //进入循环，天数+1
            day++;
            total+=2.5;
            if(total>=100){
                //钱攒够了
                break;
            }
            if(day%5==0){
                total -= 6;
            }
        }
        System.out.println("day = " + day);
    }
}
